﻿namespace GoodAdmin.Core;

public class JobConst
{
    #region 作业创建类型枚举
    /// <summary>
    /// 内置
    /// </summary>
    public const string JobCreateType_BuiltIn = "BuiltIn";
    /// <summary>
    /// 脚本
    /// </summary>
    public const string JobCreateType_Script = "Script";
    /// <summary>
    /// HTTP请求
    /// </summary>
    public const string JobCreateType_Http = "Http";
    #endregion

    #region 作业集群状态
    /// <summary>
    /// 宕机
    /// </summary>
    public const string JobClusterStatus_Crashed = "Crashed";
    /// <summary>
    /// 工作中
    /// </summary>
    public const string JobClusterStatus_Working = "Working";
    /// <summary>
    /// 等待被唤醒
    /// </summary>
    public const string JobClusterStatus_Waiting = "Waiting";
    #endregion

    #region 作业触发器状态
    /// <summary>
    /// 积压
    /// </summary>
    /// <remarks>起始时间大于当前时间</remarks>
    public const string JobTriggerStatus_Backlog = "Backlog";
    /// <summary>
    /// 就绪
    /// </summary>
    public const string JobTriggerStatus_Ready = "Ready";
    /// <summary>
    /// 正在运行
    /// </summary>
    public const string JobTriggerStatus_Running = "Running";
    /// <summary>
    /// 暂停
    /// </summary>
    public const string JobTriggerStatus_Pause = "Pause";
    /// <summary>
    /// 阻塞
    /// </summary>
    /// <remarks>本该执行但是没有执行</remarks>
    public const string JobTriggerStatus_Blocked = "Blocked";
    /// <summary>
    /// 由失败进入就绪
    /// </summary>
    /// <remarks>运行错误当并未超出最大错误数，进入下一轮就绪</remarks>
    public const string JobTriggerStatus_ErrorToReady = "ErrorToReady";
    /// <summary>
    /// 归档
    /// </summary>
    /// <remarks>结束时间小于当前时间</remarks>
    public const string JobTriggerStatus_Archived = "Archived";
    /// <summary>
    /// 崩溃
    /// </summary>
    /// <remarks>错误次数超出了最大错误数</remarks>
    public const string JobTriggerStatus_Panic = "Panic";
    /// <summary>
    /// 超限
    /// </summary>
    /// <remarks>运行次数超出了最大限制</remarks>
    public const string JobTriggerStatus_Overrun = "Overrun";
    /// <summary>
    /// 无触发时间
    /// </summary>
    /// <remarks>下一次执行时间为 null </remarks>
    public const string JobTriggerStatus_Unoccupied = "Unoccupied";
    /// <summary>
    /// 未启动
    /// </summary>
    public const string JobTriggerStatus_NotStart = "NotStart";
    /// <summary>
    /// 未知作业触发器
    /// </summary>
    /// <remarks>作业触发器运行时类型为 null</remarks>
    public const string JobTriggerStatus_Unknown = "Unknown";
    /// <summary>
    /// 未知作业处理程序
    /// </summary>
    /// <remarks>作业处理程序类型运行时类型为 null</remarks>
    public const string JobTriggerStatus_Unhandled = "Unhandled";
    #endregion
}
